home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / MBLIB10.ZIP;1 / CPPEXAMP.ZIP / NETMAIL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  1.1 KB  |  81 lines

  1. #include <string.h>
  2.  
  3. #include "netmail.hpp"
  4.  
  5. /*=========================================================================*/
  6.  
  7. void NetMail::Init (char *path)
  8.  
  9. {
  10.     strcpy (Path, path);
  11.     current = net_getlastread (path);
  12.     current = Next ();
  13. }
  14.  
  15. int NetMail::First (void)
  16.  
  17. {
  18.     return (net_first (Path));
  19. }
  20.  
  21. int NetMail::Next (void)
  22.  
  23. {
  24.     return (net_next (Path, current));
  25. }
  26.  
  27. int NetMail::Last (void)
  28.  
  29. {
  30.     return (net_last (Path));
  31. }
  32.  
  33. int NetMail::Prev (void)
  34.  
  35. {
  36.     return (net_prev (Path, current));
  37. }
  38.  
  39. int NetMail::GetLastRead (void)
  40.  
  41. {
  42.     return (net_getlastread (Path));
  43. }
  44.  
  45. int NetMail::SetLastRead (int lastread)
  46.  
  47. {
  48.     return (net_setlastread (Path, lastread));
  49. }
  50.  
  51. int NetMail::ReadHdr (int msgno)
  52.  
  53. {
  54.     return (net_read_hdr (Path, msgno, &hdr));
  55. }
  56.  
  57. int NetMail::ReadText (int msgno)
  58.  
  59. {
  60.     txt = net_read_text (Path, msgno);
  61.     return (txt ? 0 : 1);
  62. }
  63.  
  64. int NetMail::Write (void)
  65.  
  66. {
  67.     return (Write (Last() + 1));
  68. }
  69.  
  70. int NetMail::Write (int msgno)
  71.  
  72. {
  73.     return (net_write (Path, msgno, &hdr, txt));
  74. }
  75.  
  76. int NetMail::Kill (int msgno)
  77.  
  78. {
  79.     return (net_kill (Path, msgno));
  80. }
  81.